<?php
/**
 * Flea Site
 *
 * @copyright  Copyright (c) 2008 Movoin Studio (http://movoin.com)
 * @license    Apache License 2.0
 * @version    $Id: Singlepage.php 130 2009-05-21 14:23:24Z movoin $
 */

//{{include
FLEA::loadClass('Controller_Base');
//}}

class Controller_Singlepage extends Controller_Base
{
    var $modelSinglepage;

    function Controller_Singlepage()
    {
        parent::Controller_Base();
        $this->modelSinglepage = & FLEA::getSingleton( 'Model_Singlepage' );
    }

    function actionIndex()
    {
        $this->_setBack();
        $data['focus'] = 'column';
        $data['column'] = $this->getColumnInf( $_GET[FLEA::getAppInf( 'columnAccessor' )] );
        $data['row'] = $this->modelSinglepage->getContent($_GET[FLEA::getAppInf( 'columnAccessor' )], $_GET['site']);
        $this->_executeView('singlepage', $data);
    }

    /**
     * 更新内容
     *
     */
    function actionUpdate()
    {
        js_alert($this->modelSinglepage->updateContent(&$_POST), 0, $this->_getBack());
    }


}
